import java.util.PriorityQueue;

/*
优先级队列也叫堆，用数组实现，底层是一棵完全二叉树
堆分为小根堆和大根堆
*/
public class TestDemo {
    public static void main1(String[] args) {
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        priorityQueue.offer(1);
        priorityQueue.offer(2);
        priorityQueue.offer(3);
        System.out.println(priorityQueue.peek());
    }
    public static void main(String[] args) {
        MyHeap heap = new MyHeap();
        int[] arr = {27,15,19,18,28,34,65,49,25,37};
        heap.createHeap(arr);
        heap.offer(90);
        heap.heapSort();
        System.out.println("------------");
    }
}
